import request from '@/utils/request'

// 获取菜单树列表
export function getMenuTreeList(data) {
    return request({
        url: `/system/sysMenuController/getMenuTreeList`,
        method: 'post',
        data: data
    })
}

// 获取职位详情
export function getMenuDetail(id) {
    return request({
        url: `/system/sysMenuController/getMenuDetail?id=${id}`,
        method: 'get'
    })
}

// 新增菜单
export function addMenu(data) {
    return request({
        url: '/system/sysMenuController/addMenu',
        method: 'post',
        data: data
    })
}

// 编辑菜单
export function updateMenu(data) {
    return request({
        url: '/system/sysMenuController/updateMenu',
        method: 'put',
        data: data
    })
}

// 删除菜单
export function deleteMenu(id) {
    return request({
        url: `/system/sysMenuController/deleteMenu?id=${id}`,
        method: 'delete'
    })
}

// 获取菜单下拉树
export function getMenuTreeSelect() {
    return request({
        url: `/system/sysMenuController/getMenuTreeSelect`,
        method: 'get'
    })
}
